[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Chain                    Loads .CHN File for Execution

 Chain(var F : <file type>);                                             [TP]

    Loads in a previously compiled .CHN file for execution. The file
    loaded in is that one previously assigned to F (using the Assign
    command). This command can only be executed from a .COM (or .CHN)
    file; if this procedure is called from a program while running under
    Turbo Pascal, an I/O error 33 ($21) is issued.

               F    A file variable of any type (text, data, untyped).

          Notes:    A .CHN file is one that has been compiled with the cHn
                    option selected (from the compiler Options menu under
                    Turbo Pascal). A .CHN file does not have the Turbo
                    Pascal runtime routines linked in; instead, it uses
                    those already in memory (from the calling program).

                    Global variables can be shared between Chained
                    programs by either using absolute address variables or
                    shared global variables. To use shared global
                    variables, make sure the variables to share are at the
                    beginning of both programs in the same exact order.
                    Also ensure that both programs use the same size of
                    code and data segments.

                    The heap is preserved when the Chained program gains
                    control.

  -------------------------------- Example ---------------------------------

           Assign(F,'MYPROG1.CHN');
           Chain(F);

See Also: Execute Assign
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson